#include "keyboardinput.h"
#include <stdio.h>
#include <string>
#include <iostream>
#include <conio.h>

using namespace std;

KeyboardInput::KeyboardInput()
{
    //ctor
}

KeyboardInput::~KeyboardInput()
{
    //dtor
}

ActionType KeyboardInput::GetPlayerAction()
{
    ActionType thisAction = NOTHING;
    while (thisAction == NOTHING)
    {
        cout << "Select action: (A)ttack, (D)efend, or (C)ast" << endl;
        char inputChar = tolower(getch());
        switch (inputChar)
        {
        case 'a':
            thisAction = ATTACK;
        break;
        case 'c':
            thisAction = CAST;
        break;
        case 'd':
            thisAction = DEFEND;
        break;
        default:
            cout << "Invalid key press" << endl;
            thisAction = NOTHING;
        break;
        }
    }
    return thisAction;

}
